/**
 * 
 */
package com.hb.webapp.util;

import java.util.List;

import com.hb.model.Category;

/**
 * @author Pham Hong Hung
 *
 */
public class ConvertUtil {

	public static String convertCategories2Options(List<Category> categories){
		if(categories == null || categories.size() == 0){
			return "";
		}
		StringBuffer buffer = new StringBuffer();
		for (Category category : categories) {
			buffer.append("<option value='" + category.getId() + "'>" + category.getName() + "</option>");
		}
		
		return buffer.toString();
	}
}
